home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / nivb / bind.frm < prev    next >
Text File  |  1995-05-07  |  12KB  |  348 lines

  1. VERSION 2.00
  2. Begin Form BindForm 
  3.    Caption         =   "Bindery Services Test"
  4.    ClientHeight    =   4155
  5.    ClientLeft      =   990
  6.    ClientTop       =   1320
  7.    ClientWidth     =   8895
  8.    Height          =   4560
  9.    Left            =   930
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4155
  13.    ScaleWidth      =   8895
  14.    Top             =   975
  15.    Width           =   9015
  16.    Begin CommandButton CloseButton 
  17.       Caption         =   "&OK"
  18.       Height          =   372
  19.       Left            =   6720
  20.       TabIndex        =   11
  21.       Top             =   3600
  22.       Width           =   1332
  23.    End
  24.    Begin ComboBox ServerNameBox 
  25.       Height          =   288
  26.       Left            =   2400
  27.       Sorted          =   -1  'True
  28.       TabIndex        =   0
  29.       Text            =   "ServerNameBox"
  30.       Top             =   3600
  31.       Width           =   2412
  32.    End
  33.    Begin ListBox BinderyObjList 
  34.       FontBold        =   -1  'True
  35.       FontItalic      =   0   'False
  36.       FontName        =   "Courier"
  37.       FontSize        =   9.75
  38.       FontStrikethru  =   0   'False
  39.       FontUnderline   =   0   'False
  40.       Height          =   2370
  41.       Left            =   240
  42.       Sorted          =   -1  'True
  43.       TabIndex        =   9
  44.       Top             =   840
  45.       Width           =   8460
  46.    End
  47.    Begin Label Label10 
  48.       Caption         =   "File Server:"
  49.       Height          =   252
  50.       Left            =   1200
  51.       TabIndex        =   10
  52.       Top             =   3600
  53.       Width           =   1092
  54.    End
  55.    Begin Label Label1 
  56.       Caption         =   "Add Props"
  57.       Height          =   252
  58.       Left            =   7560
  59.       TabIndex        =   8
  60.       Top             =   480
  61.       Width           =   972
  62.    End
  63.    Begin Label Label7 
  64.       Caption         =   "Scan"
  65.       Height          =   252
  66.       Left            =   7080
  67.       TabIndex        =   7
  68.       Top             =   480
  69.       Width           =   492
  70.    End
  71.    Begin Label Label9 
  72.       BorderStyle     =   1  'Fixed Single
  73.       Height          =   12
  74.       Left            =   7080
  75.       TabIndex        =   12
  76.       Top             =   360
  77.       Width           =   1452
  78.    End
  79.    Begin Label Label4 
  80.       Caption         =   "Object ID"
  81.       Height          =   252
  82.       Left            =   4920
  83.       TabIndex        =   6
  84.       Top             =   360
  85.       Width           =   852
  86.    End
  87.    Begin Label Label3 
  88.       Caption         =   "Object Type"
  89.       Height          =   252
  90.       Left            =   3120
  91.       TabIndex        =   5
  92.       Top             =   360
  93.       Width           =   1092
  94.    End
  95.    Begin Label Label2 
  96.       Caption         =   "Object Name"
  97.       Height          =   252
  98.       Left            =   312
  99.       TabIndex        =   4
  100.       Top             =   372
  101.       Width           =   1212
  102.    End
  103.    Begin Label Label6 
  104.       Alignment       =   2  'Center
  105.       Caption         =   "Dyn/ Stat"
  106.       Height          =   372
  107.       Left            =   6384
  108.       TabIndex        =   3
  109.       Top             =   252
  110.       Width           =   612
  111.    End
  112.    Begin Label Label5 
  113.       Alignment       =   2  'Center
  114.       Caption         =   "Has Props"
  115.       Height          =   372
  116.       Left            =   5880
  117.       TabIndex        =   2
  118.       Top             =   240
  119.       Width           =   612
  120.    End
  121.    Begin Label Label8 
  122.       Caption         =   "Access Control"
  123.       Height          =   252
  124.       Left            =   7140
  125.       TabIndex        =   1
  126.       Top             =   84
  127.       Width           =   1332
  128.    End
  129. End
  130.  
  131. Sub CloseButton_Click ()
  132.     Unload BindForm
  133. End Sub
  134.  
  135. Sub Form_Load ()
  136.     For connID% = 1 To 8
  137.         fileServerName$ = String$(48, 0)
  138.         If (IsConnectionIDInUse(connID%) = 1) Then
  139.             GetFileServerName connID%, fileServerName$
  140.             ServerNameBox.AddItem fileServerName$
  141.         End If
  142.     Next connID%
  143.  
  144.     'get name of default file server for combo box
  145.     fileServerName$ = GetDefaultFileServerName()
  146.     ServerNameBox.Text = fileServerName$
  147.  
  148.     Main.MousePointer = 0
  149. End Sub
  150.  
  151. Sub Form_Unload (Cancel As Integer)
  152.     SetPreferredConnectionID (originalPrefConnID%)
  153. End Sub
  154.  
  155. Sub ScanBindery ()
  156.     Dim objectType As String * 6
  157.  
  158.     BinderyObjList.Clear
  159.  
  160.     oID& = -1   'initialize object ID to -1 for first call to ScanBinderyObject
  161.     Do
  162.         oName$ = String$(48, 0)
  163.         ccode% = ScanBinderyObject("*", OT_WILD, oID&, oName$, oType%, oHasProps%, oFlag%, oSecurity%)
  164.         If (ccode% = SUCCESSFUL) Then
  165.             
  166.             'take all characters of object name up to terminating null
  167.             out$ = Left$(oName$, InStr(oName$, Chr$(0)) - 1)
  168.  
  169.             'then take first 20 chars
  170.             out$ = Left$(out$, 20)
  171.  
  172.             'pad with spaces
  173.             out$ = out$ + Space$(22 - Len(out$))
  174.             
  175.             Select Case oType%
  176.                 Case OT_USER
  177.                     out$ = out$ + "User            "
  178.                 Case OT_USER_GROUP
  179.                     out$ = out$ + "User Group      "
  180.                 Case OT_PRINT_QUEUE
  181.                     out$ = out$ + "Print Queue     "
  182.                 Case OT_FILE_SERVER
  183.                     out$ = out$ + "File Server     "
  184.                 Case OT_JOB_SERVER
  185.                     out$ = out$ + "Job Server      "
  186.                 Case OT_GATEWAY
  187.                     out$ = out$ + "Gateway         "
  188.                 Case OT_PRINT_SERVER
  189.                     out$ = out$ + "Print Server    "
  190.                 Case OT_ARCHIVE_QUEUE
  191.                     out$ = out$ + "Archive Queue   "
  192.                 Case OT_ARCHIVE_SERVER
  193.                     out$ = out$ + "Archive Server  "
  194.                 Case OT_JOB_QUEUE
  195.                     out$ = out$ + "Job Queue       "
  196.                 Case OT_ADMINISTRATION
  197.                     out$ = out$ + "Administration  "
  198.                 Case OT_NAS_SNA_GATEWAY
  199.                     out$ = out$ + "NAS SNA Gateway "
  200.                 Case OT_NACS
  201.                     out$ = out$ + "NACS            "
  202.                 Case OT_REMOTE_BRIDGE_SERVER
  203.                     out$ = out$ + "Rem Bridge Serv "
  204.                 Case OT_BRIDGE_SERVER
  205.                     out$ = out$ + "Bridge Server   "
  206.                 Case OT_TCPIP_GATEWAY
  207.                     out$ = out$ + "TCP/IP Gateway  "
  208.                 Case OT_GATE
  209.                     out$ = out$ + "Gateway         "
  210.                 Case OT_TIME_SYNCHRONIZATION_SERVER
  211.                     out$ = out$ + "Time Synch Serv "
  212.                 Case OT_ARCHIVE_SRV
  213.                     out$ = out$ + "Archive Server  "
  214.                 Case OT_ADVERTISING_PRINT_SERVER
  215.                     out$ = out$ + "Adver Print Srv "
  216.                 Case OT_BTRIEVE_VAP_NLM_5XX
  217.                     out$ = out$ + "Btrieve v5.xx   "
  218.                 Case OT_SQL_VAP_NLM
  219.                     out$ = out$ + "SQL VAP/NLM     "
  220.                 Case OT_XTREE_NETWORK
  221.                     out$ = out$ + "Xtree Net Ver   "
  222.                 Case OT_BTRIEVE_VAP_NLM_4XX
  223.                     out$ = out$ + "Btrieve v4.xx   "
  224.                 Case OT_APPLETALK_GATEWAY
  225.                     out$ = out$ + "AppleTalk Gatew "
  226.                 Case OT_X25_GATEWAY
  227.                     out$ = out$ + "X.25 Gateway    "
  228.                 Case OT_WAN_COPY
  229.                     out$ = out$ + "WAN Copy        "
  230.                 Case OT_TES_NETWARE_VMS
  231.                     out$ = out$ + "TES-NetWare VMS "
  232.                 Case OT_NETWARE_ACCESS_SERVER
  233.                     out$ = out$ + "NW Access Serv  "
  234.                 Case OT_PORTABLE_NETWARE
  235.                     out$ = out$ + "Portable NetW   "
  236.                 Case OT_COMPAQ_IDA_STATUS_MONITOR
  237.                     out$ = out$ + "Compaq IDA Stat "
  238.                 Case OT_NETWARE_386_SERVER
  239.                     out$ = out$ + "NetWare 386 Srv "
  240.                 Case OT_CSA_MUX
  241.                     out$ = out$ + "CSA MUX         "
  242.                 Case OT_C